import React from 'react'
import Show from './Show';
import Control from './Control';
import store from '../../redux/store';
import { jiaAction, jianAction } from '../../redux/reducers/zanReducer';

export default function ReduxCom() {
  return (
    <div style={{padding: 30}}>
      <Show  />
      <Control  />
      <hr />
      <h2>点赞数: {store.getState().zan.value}</h2>
      <button onClick={() => {
        store.dispatch(jiaAction(10));
      }}>新增</button>
       <button onClick={() => {
        store.dispatch(jianAction(10));
      }}>减少</button>
    </div>
  )
}
